package com.zsrt.java.ch01;


import org.junit.Test;

public class LinkTest {

	@Test
	public void test() {
		
		Node head = new Node();
		
		Link list  = new Link(head);
		
		//1 添加3个节点  3 5 9
		Node node1 = new Node(3);
		Node node2 = new Node(5);
		Node node3 = new Node(9);
		
		list.addNode(node1);
		list.addNode(node2);
		list.addNode(node3);
		//2 打印链表
		list.printAllNodes();
		
		
		//3 删除节点5
		list.deleteNode(5);
		list.printAllNodes();
		
		
		//4 插入节点6
		Node node6 = new Node(6);
		
		list.insertNode(node1, node6);
		list.printAllNodes();
		
		
	}

}
